////////////////////////////////////////////////////////////////////////////////////////////////////
/// Copyright (c) 2009 - 2010 RacoonStudios
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of this
/// software and associated documentation files (the "Software"), to deal in the Software
/// without restriction, including without limitation the rights to use, copy, modify, merge,
/// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
/// to whom the Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in all copies or
/// substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
/// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
/// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
/// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once
#ifndef point2_h__
#define point2_h__

#include "math/float2.h"
#include "math/vector2.h"

namespace Math
{
	////////////////////////////////////////////////////////////////////////////////////////////////////
	/// \class	point2
	///
	/// \brief	A simple point within the 2d world. You could use it for 2d games,
	///			or maybe also for gui stuff.
	///
	/// \author	khaos
	/// \date	06.12.2009
	////////////////////////////////////////////////////////////////////////////////////////////////////
	class point2 : public float2
	{
		public:

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2()
			///
			/// \brief	Default constructor. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2();

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2(scalar x, scalar y)
			///
			/// \brief	Constructor. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	x	The x coordinate. 
			/// \param	[in]	y	The y coordinate. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2(scalar x, scalar y);

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2(const point2 & rhs)
			///
			/// \brief	Constructor. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2(const point2 & rhs);

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2(const float2 & rhs)
			///
			/// \brief	Constructor. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2(const float2 & rhs);




			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	void operator= (const point2 & rhs)
			///
			/// \brief	Copy operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			void operator = (const point2 & rhs);

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	bool operator== (const point2 & rhs) const
			///
			/// \brief	Equality operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	True if both point2 are equal, otherwise false.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			bool operator == (const point2 & rhs) const;

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	bool operator!= (const point2 & rhs) const
			///
			/// \brief	Inequality operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	True if both point2 are inequal, otherwise false.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			bool operator != (const point2 & rhs) const;

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	void operator+= (const vector2 & rhs)
			///
			/// \brief	Assignment by addition operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			void operator += (const vector2 & rhs);

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	void operator-= (const vector2 & rhs)
			///
			/// \brief	Assignment by subtraction operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			////////////////////////////////////////////////////////////////////////////////////////////////////
			void operator -= (const vector2 & rhs);

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	vector2 operator+ (const point2 & rhs) const
			///
			/// \brief	Addition operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	The resulting vector2.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			vector2 operator + (const point2 & rhs) const;

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2 operator+ (const vector2 & rhs) const
			///
			/// \brief	Addition operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	The new position of the point2.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2 operator + (const vector2 & rhs) const;

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	vector2 operator- (const point2 & rhs) const
			///
			/// \brief	Negation operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	The resulting vector2.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			vector2 operator - (const point2 & rhs) const;

			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	point2 operator- (const vector2 & rhs) const
			///
			/// \brief	Negation operator. 
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	rhs	The right hand side object. 
			///
			/// \return	The new position of the point2.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			point2 operator - (const vector2 & rhs) const;





			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	void set(scalar x, scalar y)
			///
			/// \brief	Sets the x and y coordinates.
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \param	[in]	x	The scalar for x coordinate.
			/// \param	[in]	y	The scalar for y coordinate.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			void set(scalar x, scalar y);






			////////////////////////////////////////////////////////////////////////////////////////////////////
			/// \fn	static point2 origin()
			///
			/// \brief	Returns a point2 representation of the origin.
			///
			/// \author	khaos
			/// \date	06.12.2009
			///
			/// \return	The origin point2.
			////////////////////////////////////////////////////////////////////////////////////////////////////
			static point2 origin();

		protected:
			
		private:

	};

}

#endif // point2_h__